package com.bdqn.zhang.dao;

import com.bdqn.zhang.entity.SysUser;
import com.bdqn.zhang.entity.Users;
import org.springframework.orm.hibernate5.support.HibernateDaoSupport;

import java.util.List;

/**
 * Created by 任 on 2019/4/12.
 */
public class UsersDaoImpl extends HibernateDaoSupport implements UsersDao{
    @Override
    public List<Users> findByUsers(Users users) {
        List<Users> userList = (List<Users>)this.getHibernateTemplate().findByValueBean("from USERS u where u.cardid=:cardid and u.password=:password",users);
        if(userList.size() > 0 && userList != null){
            return userList;
        } else {
            return null;
        }
    }

    @Override
    public void save(Users users) {
//        this.getHibernateTemplate().save(users);
//        this.getHibernateTemplate().load(Users.class,users.getCardid());
    }
}
